"-------------------------------------------------------------------------------
" additional mapping : complete a classical C comment: '/*' => '/* | */'
"-------------------------------------------------------------------------------
inoremap  <buffer>  /*       /*<Space><Space>*/<Left><Left><Left>
"vnoremap  <buffer>  /*      s/*<Space><Space>*/<Left><Left><Left><Esc>p
"
"-------------------------------------------------------------------------------
" additional mapping : complete a classical C multi-line comment: 
"                      '/*<CR>' =>  /*
"                                    * |
"                                    */
"-------------------------------------------------------------------------------
inoremap  <buffer>  /*<CR>  /*<CR><CR>/<Esc>kA<Space>
"
"-------------------------------------------------------------------------------
" additional mapping : {<CR> always opens a block
"-------------------------------------------------------------------------------
inoremap  <buffer>  {<CR>  {<CR>}<Esc>O
vnoremap  <buffer>  {<CR> s{<CR>}<Esc>P=iB

inoremap <buffer> " ""<Esc>i
inoremap <buffer> ' ''<Esc>i

nmap ** :.s#^\(\s*\)\(.*\)\s*$#\1/* \2 */#<CR>==
"vmap ** :s#^\(\s*\)\(.*\)\s*$#\1/* \2 */#<CR>==
vmap ** <Esc><Esc>'<O#if 0<Esc>'>o#endif<Esc>'<V'>
nmap && :.s#^\(\s*\)/\*\s*\(.*\)\s*\*/\s*$#\1\2#<CR>==
vmap && <Esc><Esc>'<:.-1,.s/^\s*#if\s*0\s*$//<CR>'>:.,.+1s/^\s*#endif\s*$//<CR>'<V'>
"vmap && :s#^\(\s*\)/\*\s*\(.*\)\s*\*/\s*$#\1\2#<CR>==

nmap pr <Esc>:.s/^\(\s*\)\(.*\)$/\1printf( "\2\\n" );/<CR>
nmap rp <Esc>:.s/^\(\s*\)printf\s*(\s*"\([^"]\)"\(\\\)\@<!.*$/\1\2/<CR>==

"nmap == ==<Esc>:.s/(\([^ \t]\)/( \1/g<CR><Esc><Esc>:.s/\([^ \t]\))/\1 )/g<CR>
"vmap = ='<V'>:s/(\([^ \t]\)/( \1/g<CR>'<V'>:s/\([^ \t]\))/\1 )/g<CR>
nmap ;; <Esc>:.s/\(.*\)\s*$/\1;/<CR>
vmap ;; <Esc>:s/\(.*\)\s*$/\1;/<CR>
